package com.school.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.school.manager.domaim.SysRole;
import com.school.manager.entity.po.SysRolePo;
import com.school.manager.entity.vo.SysRoleVo;
import com.school.manager.mapper.SysRoleMapper;
import com.school.manager.service.ISysRoleService;
import com.school.manager.utils.PageUtil;

import lombok.extern.slf4j.Slf4j;

/**
 * description：系统角色业务实现类
 * date：2021/10/133:18 下午
 */

@Service
@Slf4j
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {
	
	@Autowired
    private SysRoleMapper sysRoleMapper;
	
	@Override
	public Page<SysRoleVo> page(SysRolePo sysRolePo) {
		QueryWrapper<SysRole> queryWrapper = PageUtil.buildQueryWrapper(sysRolePo, SysRole.class);
        Page<SysRole> page = new Page<>(sysRolePo.getCurrent(), sysRolePo.getSize());
        sysRoleMapper.selectPage(page, queryWrapper);
        return PageUtil.buildPage(page, SysRoleVo.class);
	}
	

}
